Repository navigation
Conversation
… BookDate and shelf sync Keyword search on the catalog API returns every language, so on a non-English region search, BookDate and shelf sync can surface (and request) editions that are not in the region's language. New admin setting `audible.language_filter` (off by default), a checkbox under the Audible region in Settings > Library. When on, `search()` drops products whose language fails `isAcceptedLanguage()` for the region, for callers that pass `respectLanguageFilter`. Bulk import does not, since it matches files on disk. Refs kikootwo#259 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eyji
force-pushed
the
feat/259-language-filter
branch
from
October 19, 2026 19:19
f8d5dbd to
21ef4eb
Compare
Owner
|
Thanks for picking this up, and for coming with tests. I'm going through it alongside #259 and will reply here soon. |
Owner
Owner
|
@Eyji this is out in v1.2.13, landed in #527: https://github.com/kikootwo/ReadMeABook/releases/tag/v1.2.13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #259
On a French store, keyword search also returns the English and Spanish editions. BookDate and shelf sync both keep the first search result, so BookDate recommended the English Six of Crows to me (there's no French audio edition) and accepting it created a request that can't be filled. Popular, new releases and categories come from the region's storefront and were fine, so I left them alone.
This adds an admin setting,
audible.language_filter, off by default. It shows up as a checkbox under the Audible region in Settings > Library, for both Plex and Audiobookshelf. When it's on,AudibleService.search()drops products whoselanguagefailsisAcceptedLanguage()for the region and keeps the ones with no language at all. Callers opt in with{ respectLanguageFilter: true }. The search page, BookDate'smatchToAudnexusand shelf sync do; bulk import doesn't, since it has to match files already on disk.A few details:
hasMoreis now computed on the raw page, so a page where everything got filtered out doesn't end pagination.PUT /api/admin/settings/audibleaccepts an optional booleanlanguageFilter. Leaving it out keeps the stored value, anything else is a 400.GET /api/admin/settingsreturnsaudibleLanguageFilter.noMatchand get the usual 7-day retry.hasMoretrue. That only happens on queries in another language, and I didn't want to touch the search page in this PR.audible_refreshwhen only the checkbox changed. Every save already did that.Docs are updated in
integrations/audible.md,settings-pages.mdandfeatures/bookdate.md. I moved the Audible settings route tests into their own file soadmin-settings-core.routes.test.tsstays under 400 lines.audible.service.tsandbookdate/helpers.tswere already over the limit before this.The full
npm testpasses (2640 tests),tsc --noEmitis clean anddocker build -f dockerfile.unified .builds. I haven't run a full instance, so there's no screenshot. It's a single checkbox under the region dropdown, styled like the "Trigger library scan after import" one.